package cn.net.vote.data.pojo.es;

import java.io.Serializable;
import java.math.BigInteger;

import cn.net.vote.data.domain.PageData;
import org.springframework.data.elasticsearch.annotations.Document;

/**
 *
 * @Title: Test
 * @Description:
 * ES测试实体类
 * indexName:索引库的名称,类似数据库
 * type:类型，类似表
 * @Version:1.0.0
 * @author pancm
 * @date 2018年4月24日
 */
@Document(indexName = "testindex", type = "test")
public class EsTest implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    /**
     * 编号
     */
    private Integer id;
    /**
     * 商标名称
     */
    private String title;
    /**
     * 申请日期
     */
    private BigInteger apply_date;
    /**
     * 申请人名称中文
     */
    private String applicant_ch;
    /**
     * 申请人名称英文
     */
    private String applicant_en;
    /**
     * 申请人地址中文
     */
    private String address_ch;
    /**
     * 代理/办理机构
     */
    private String agency;
    /**
     * 最新商标状态
     */
    private Integer latest_status;
    /**
     * 专用权期限开始时间
     */
    private BigInteger options_start;
    /**
     * 专用权期限结束时间
     */
    private BigInteger options_end;
    /**
     * 修改日期
     */
    private BigInteger update;


    public EsTest(PageData pageData) {
        this.id =  Integer.parseInt(pageData.get("id").toString());
        this.title =  pageData.get("title").toString();
        this.apply_date = new BigInteger(pageData.get("apply_date").toString());
        this.applicant_ch = pageData.get("applicant_ch").toString();
        this.applicant_en = pageData.get("applicant_en").toString();
        this.address_ch =  pageData.get("address_ch").toString();
        this.agency =  pageData.get("agency").toString();
        this.latest_status = Integer.parseInt(pageData.get("latest_status").toString());
        this.options_start =new BigInteger(pageData.get("options_start").toString());
        this.options_end = new BigInteger(pageData.get("options_end").toString());
        this.update = new BigInteger(pageData.get("update").toString());
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setApply_date(BigInteger apply_date) {
        this.apply_date = apply_date;
    }

    public void setApplicant_ch(String applicant_ch) {
        this.applicant_ch = applicant_ch;
    }

    public void setApplicant_en(String applicant_en) {
        this.applicant_en = applicant_en;
    }

    public void setAddress_ch(String address_ch) {
        this.address_ch = address_ch;
    }

    public void setAgency(String agency) {
        this.agency = agency;
    }

    public void setLatest_status(Integer latest_status) {
        this.latest_status = latest_status;
    }

    public void setOptions_start(BigInteger options_start) {
        this.options_start = options_start;
    }

    public void setOptions_end(BigInteger options_end) {
        this.options_end = options_end;
    }

    public void setUpdate(BigInteger update) {
        this.update = update;
    }

    public EsTest(Integer id, String title, BigInteger apply_date, String applicant_ch, String applicant_en, String address_ch, String agency, Integer latest_status, BigInteger options_start, BigInteger options_end, BigInteger update) {
        this.id = id;
        this.title = title;
        this.apply_date = apply_date;
        this.applicant_ch = applicant_ch;
        this.applicant_en = applicant_en;
        this.address_ch = address_ch;
        this.agency = agency;
        this.latest_status = latest_status;
        this.options_start = options_start;
        this.options_end = options_end;
        this.update = update;
    }

    @Override
    public String toString() {
        return "EsTest[" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", apply_date=" + apply_date +
                ", applicant_ch='" + applicant_ch + '\'' +
                ", applicant_en='" + applicant_en + '\'' +
                ", address_ch='" + address_ch + '\'' +
                ", agency='" + agency + '\'' +
                ", latest_status=" + latest_status +
                ", options_start=" + options_start +
                ", options_end=" + options_end +
                ", update=" + update +
                ']';
    }
}